setVulkanSurfaceTarget

fun RenderSessionHandle.setVulkanSurfaceTarget(replacement: VulkanSurfaceReplacement): Completion<Unit>

Replaces the Vulkan surface that the session presents to.

Use it to give the session a surface again after RenderSessionHandle.releaseTarget(), to move it to another surface, or to resize it. Once the replacement completes, the session no longer uses the old surface.

See mln_render_session_set_vulkan_surface_target in the C API reference.

Errors:

  • Status.UNSUPPORTED when the new surface needs a different color format or pre-rotation support than the old one. Attach a new session instead.